package cn.myword.wordTemple.demo;

import com.alibaba.fastjson.JSONObject;
import cn.myword.wordTemple.mapper.UniqueWordGenerate;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Demo extends UniqueWordGenerate {
    public Demo() {
        super();
    }

    public static void main(String[] args) throws Exception {

        Demo demo=new Demo();
        //demo.setSrcPath("C:/temple.docx");
        demo.pushParam("demo","这是demo的");

        List<Map<String,Object>> demos=new ArrayList<>();
        for (int i=0;i<5;i++){
            Map<String,Object> map=new HashMap<>();
            map.put("myname","名字"+i);
            map.put("age","年龄"+i);
            demos.add(map);
        }
        demo.pushList(demos);//push要按实际顺序

        List<Map<String,Object>> demoTwos=new ArrayList<>();
        for (int i=0;i<5;i++){
            Map<String,Object> map=new HashMap<>();
            map.put("otherName","其它名字"+i);
            map.put("description","描述"+i);
            demoTwos.add(map);
        }
        demo.pushList(demoTwos);

        JSONObject jsonObject=demo.generate();

        System.out.println(jsonObject.toJSONString());
    }



}
